﻿<%@ Page Theme="BlueSkin" Title="LMS : Forgetted my password" Language="C#" MasterPageFile="~/LmsWebSite/MasterEN.master" AutoEventWireup="true"
    CodeFile="ForgetPasswordEN.aspx.cs" Inherits="ForgetPasswordEN" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

<script type="text/javascript">


    function trimLeft(strIn) {
        try {
            while (strIn.length > 0) {
                if (strIn.charAt(0) == ' ') {
                    if (strIn.length > 1) {
                        strIn = strIn.substring(1, strIn.length);

                    }
                    else
                        return '';
                }
                else
                    return strIn;
            }
        }
        catch (e) {
            return strIn;
        }

        return strIn;

    }

    function trimRight(strIn) {

        try {
            while (strIn.length > 0) {
                if (strIn.charAt(strIn.length - 1) == ' ') {
                    if (strIn.length > 1) {
                        strIn = strIn.substring(0, strIn.length - 1);

                    }
                    else
                        return '';
                }
                else
                    return strIn;
            }
        }
        catch (e) {
            return strIn;
        }

        return strIn;
    }



    function validateUser(source, args) {
        var txtBadge = document.getElementById('<%# txtBadge.ClientID %>');
        var txtID = document.getElementById('<%# txtID.ClientID %>');

        var varStr1 = trimLeft(trimRight(txtBadge.value));
        var varStr2 = trimLeft(trimRight(txtID.value));

        if (varStr1 == '' && varStr2 == '') {
            args.IsValid = false;
            return;
        }

        if (varStr1 != '' && varStr2 != '') {
            args.IsValid = false;
            return;
        }

        args.IsValid = true;


    }
        
        
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <asp:UpdateProgress ID="uprogress1" runat="server">
                <ProgressTemplate>
                    <div style="position: fixed; width: 30px; height: 30px; top: 0px; right: 0px; border: 1px solid orange;">
                        <img src="images/loading.gif" style="width: 30px; height: 30px;" alt='Loading' title='Loading' />
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <table cellspacing="5" cellpadding="5" width="100%">
                <tr>
                    <td align="left" class="heading">
                        Forgetted my password
                    </td>
                </tr>
            </table>
            <br />
            <div class="aligning allWidthWithMargins  direction" style="margin-bottom: 20px;
                margin-left: 30px; margin-right: 30px; font-size: 14px;">
                <div class="floating aligning direction" style="width: 200px;">
                    <asp:Label ID="lblBadgeHead" runat="server" Text="Badge# *"></asp:Label>
                </div>
                <div class="floating aligning direction" style="width: 250px;">
                    <asp:TextBox ID="txtBadge" runat="server" Text="" Style="width: 250px;"></asp:TextBox>
                </div>
                <div class="floating aligning direction">
                <asp:CustomValidator ID="cv1" runat="server" 
                    ErrorMessage="Please enter your badge !" 
                     onservervalidate="cv1_ServerValidate" ClientValidationFunction="validateUser">*</asp:CustomValidator>

                </div>
                <div class="clearing" style="width: 1px; height: 10px;display:none;">
                </div>


                <div class="floating aligning direction" style="width: 200px;display:none;">
                    <asp:Label ID="lblIDHead"  runat="server" Text="ID# *"></asp:Label>
                </div>
                <div class="floating aligning direction" style="width: 250px;display:none;">
                    <asp:TextBox ID="txtID" runat="server" Text="" Style="width: 250px;"></asp:TextBox>
                </div>
                <div class="floating aligning direction" style="display:none;">
                </div>
                <div class="clearing" style="width: 1px; height: 10px;">
                </div>


                <div class="floating aligning direction" style="width: 450px;">
                    <div class="aligning direction" style="float: right;">
                        <asp:Button ID="btnSubmit" runat="server" Text="Reset password" 
                            BorderStyle="Solid" BorderColor="Orange" BackColor="DarkOrange" 
                            ForeColor="White" onclick="btnSubmit_Click" />
                        <div class="clearing">
                        </div>
                    </div>
                    
                    <div class="clearing">
                    </div>
                </div>
                <div class="clearing" style="width: 1px; height: 10px;">
                </div>
                <div class="aligning allWidthWithMargins  direction">
                    <asp:Label ID="lblError" runat="server" Text="" ForeColor="Red" Style="margin-left: 30px;"
                        EnableViewState="false"></asp:Label>
                    <div class="clearing">
                    </div>
                    <asp:Label ID="lblResult" runat="server" Text="" ForeColor="Green" Style="margin-left: 30px;"
                        EnableViewState="false"></asp:Label>
                    <div class="clearing">
                    </div>
                </div>
                <div class="clearing">
                </div>
                <div class="aligning allWidthWithMargins  direction">
                    <asp:ValidationSummary ID="vsError" runat="server" />
                    <div class="clearing">
                    </div>
                </div>
                <div class="clearing">
                </div>
            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
